package com.wy.customer;

import com.wy.utils.Constant;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @描述
 * @创建人 wangyue
 * @创建时间2019/12/1211:31
 */

@Component
@RabbitListener(queues = Constant.WORK_QUEUE)
public class WorkReceiver {

    @RabbitHandler
    public void process(Message message, String hello) {
        //String messageId = message.getMessageProperties().getMessageId();
        //调用redis.incr(messageId); 如果返回0说明没有被消费过，如果返回大于0的，说明已经被消费
        //
        System.out.println("ReceiverA  : " + hello);
    }
}
